<?php

use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;

class CreateRegion extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('region', function (Blueprint $table) {
            $table->integerIncrements('id')->comment('区域主键');
            $table->string('name', 40)->nullable()->comment('区域名称');
            $table->unsignedInteger('pid')->nullable()->comment('区域上级标识');
            $table->string('sname', 40)->nullable()->comment('地名简称');
            $table->unsignedInteger('level')->nullable()->comment('区域等级');
            $table->string('citycode', 20)->nullable()->comment('区域编码');
            $table->string('yzcode', 20)->nullable()->comment('邮政编码');
            $table->string('mername', 100)->nullable()->comment('组合名称');
            $table->float('Lng')->nullable();
            $table->float('Lat')->nullable();
            $table->string('pinyin', 100)->nullable();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('region');
    }
}
